package com.soushin.mvpdemo.module.login;

import android.content.Intent;

import com.blankj.ALog;

import com.soushin.mvpdemo.base.BasePresenter;
import com.soushin.mvpdemo.module.main.MainActivity;

/**
 * Created by SouShin on 2018/10/91353.
 */
public class LoginPresenter extends BasePresenter<LoginView> {
    public LoginPresenter() {
    }

    public void goLogin(){
        ALog.e("登录操作开始");
        getMvpView().showProgress("正在登录");
        // TODO: 2018/10/9 在这里进行登录请求,并处理请求回调
        /*HttpUtils.get/post*/
        getMvpView().disProgress();
        getMvpView().showToasty("登录成功");
    }

    public void goMain(){
        Intent intent=new Intent();
        intent.putExtra("success","登录成功");
        getMvpView().goTo(MainActivity.class,intent);
    }

    @Override
    public void unsubscribe() {
        getMvpView().disProgress();
        super.unsubscribe();
    }
}
